<h3 class="yonghu">过户信息</h3>
<div class="chezhu-xinxi">
    <div class="xinxi-conter xinxi-conter1" style="background: none;margin-bottom:10px;border: none">
        <h4 class="order_no">拍卖单号：<b>{$order.order_no}</b></h4>
    </div>
  <div class="transfer">
      <div class="xinxi-conter xinxi-conter1">
        <h4>车辆信息</h4>
        <ul>
            <li class="clearfix">
                <em>车型</em><em class="name-text">{$car.model}</em>
                <em>排放标准</em><em class="dian-hua"><?php echo C('EMISSION')[$car['emission']];?></em>
            </li>

            <li class="clearfix">
                <em>初登日期</em><em class="name-text">{$car.first_reg_date}</em>
                <em>颜色</em><em class="dian-hua"><?php echo C('CAR_COLOR')[$car['car_color']];?></em>
            </li>
            <li class="clearfix">
                <em>表显里程</em><em class="name-text">{$car.pointer_mileage}万公里</em>
                <em>车况级别</em><em class="name-text">{$car.composite_state}{$car.accident_level}</em>
            </li>
            <li class="clearfix">
                <em>车辆注册地</em><em class="name-text">{$car.reg_city}</em>
                <em>所在地</em><em class="name-text">{$location_area}</em>
            </li>
            <li class="clearfix">
                <em>车牌号</em><em class="name-text">{$car.plate}</em>
                <em>车架号</em><em class="name-text">{$car.vin}</em>
            </li>
            <li class="clearfix">
                <em>年检有效期</em><em class="name-text">{$car.verify_expiry}</em>
                <em>交强险有效期</em><em class="name-text">{$car.com_insure_expiry}</em>
            </li>
<!--             <li class="clearfix">
                <em>违章查询</em><em class="name-text">罚扣{$car.ill_deduc_point}分   罚款{$car.forfeit}元</em>
                <em>过户限制</em><em class="name-text"><?php echo C('TRANSFER_LIMIT')[$car['transfer_limit']];?></em>
            </li> -->
            <li class="clearfix">
                <em>渠道来源</em><em class="name-text">
                    <if condition="$car.comefrom neq ''">
                    <?php if(empty($car['comefrom_url'])):?>
                      <?php echo $show_from[$car['comefrom']];?>
                    <?php else: ?>
                      <a href="{$car.comefrom_url}" target="_blank" rel="noreferrer"><?php echo $show_from[$car['comefrom']];?></a>
                    <?php endif;?>
                    <else/>
                      未知
                    </if>
                </em>
                <em>最终成交价</em><em class="name-text">{$last_trans_price} 元</em>
            </li>
        </ul>
      </div>
      <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>过户信息</h4>
        <ul>
            <li class="clearfix">
                <em>过户限制</em><em class="name-text">{$transfer_info.transfer_limit}</em>
                <em>开票要求</em><em class="name-text">{$transfer_info.invoice} 元</em>
            </li>
            <li class="clearfix">
                <em>车辆落户</em>
                <em class="name-text">--</em>
                <em>过户要求</em><em class="name-text">{$transfer_info.transfer_type}</em>
            </li>
             <li class="clearfix procedures">
                <em class="uploadText1">手续上传要求</em><em class="name-text uploadText" style="width:827px;">{$transfer_info.procedures_upload}</em>
            </li>
            <li class="clearfix ">
                <em>车辆补充说明</em>
                <em class="name-text supplement" style="width:827px;">{$car.other_info}</em>
            </li>
        </ul>
      </div>
      <br/>

      <div class="xinxi-conter xinxi-conter1">
        <h4>原车主信息</h4>
        <ul>
            <li class="clearfix">
                <em>车主类型</em><em class="name-text">{$owner.owner_type_name}</em>
                <if condition="$owner.owner_type eq 1">
                    <em>原车主姓名</em><em class="name-text">{$owner.seller_name}</em>
                    <else />
                    <em>原公司名称</em><em class="dian-hua">{$owner.seller_name}</em>
                </if>
            </li>
            <li class="clearfix">
                <if condition="$owner.owner_type eq 1">
                    <em>原联系电话</em><em class="name-text">{$owner.phone}</em>
                    <else />
                    <em>原联系人姓名</em><em class="name-text">{$owner.contact_person}</em>
                    <em>原联系电话</em><em class="dian-hua">{$owner.phone}</em>
                </if>
            </li>
            <input type="hidden" name="owner_id" value="{$owner.owner_id}"  id="owner_id" />
        </ul>
      </div>

      <div class="xinxi-conter xinxi-conter1">
        <h4>评估师信息</h4>
        <ul>
            <li class="clearfix">
                <em>评估师</em><em class="name-text">{$checker_info.real_name}</em>
                <em>评估师电话</em><em class="dian-hua">{$checker_info.mobile}</em>
            </li>
            <input type="hidden" name="owner_id" value="{$owner.owner_id}"  id="owner_id" />
        </ul>
      </div>
      <br/>
      <script>
          $("#bianji").on("click", function(e){
              var $that = $(this),
                  thisText = $that.val();
              if(thisText === "编辑"){
                  $that.val("保存");
                  $("#certificate_number").removeAttr("readonly");
                  $("#certificate_number").css("border","1px solid #303030");
              } else if(thisText === "保存"){
                  var certificate_number = $('#certificate_number').val();
                  var owner_id = $('#owner_id ').val();
                  var data = {
                    'certificate_number' :certificate_number,
                    'owner_id':owner_id
                  };
                  $.post('/Transfer/eidt_cn',data,function(msg){
                    if (JSON.parse(msg).code == "200") {
                      $that.val("编辑");
                      $("#certificate_number").attr("readonly", "readonly");
                      $("#certificate_number").css("border","none");
                    }else{
                      shibai_alert(JSON.parse(msg).msg,1500)
                      return false;
                    }
                  }); 
              }
          });
      </script>
      <div class="xinxi-conter xinxi-conter1">
        <h4>车商信息</h4>
        <ul>
            <li class="clearfix">
                <em>车商联系人</em><em class="name-text">{$dealer.contact_person}</em>
                <em>联系人电话</em><em class="dian-hua">{$dealer.contact_mobile}</em>
            </li>
        </ul>
      </div>
      <br/>
      <div class="xinxi-conter xinxi-conter1">
        <h4>备注信息</h4>
        <ul>
            <li class="clearfix">
                <em>付首款备注</em><em class="name-text">{$pay_log.remark}</em>
            </li>
        </ul>
      </div>
    </div>
  </div>
<div class="listBox">
  <div class="yuList">
<!--     <div class="xuanzhe">
      <ul>
        <form id="transForm">
          <input type="hidden" name="order_id" value="{$order.order_id}"/>
          <input type="hidden" name="car_id" value="{$car.car_id}"/>
          <input type="hidden" name="owner_id" value="{$owner.owner_id}" />
            <li class="kaihu clearfix">
              <span>新车主姓名</span><input name="contact" type="text" value="" placeholder="请输入新车主姓名">
            </li>
            <li class="kaihu clearfix">
              <span>新车主电话</span><input name="phone"  type="text" value="" placeholder="请输入新车主电话">
            </li>
            <?php if($car['transfer_limit'] == 3): ?>
            <li class="kaihu clearfix">
              <span>过户限制</span>
                 <span class="menDao">
                  <a href="javascript:void(0);" onclick="$('#transfer_limit').val(1);" >本地</a>
                  <a href="javascript:void(0);" onclick="$('#transfer_limit').val(2);" >外地</a>
              </span>
              <input type="hidden" id="transfer_limit" name="transfer_limit"  value="{$car.transfer_limit}"/>
            </li>
          <?php endif ?>
            <li class="kaihu clearfix">
              <span>新车主身份证</span><input name="idcard"  type="text" value="" placeholder="请输入新车主身份证">
            </li>
            <li class="kaihu clearfix">
              <span>过户公司</span><input name="company" type="text" value="" placeholder="请输入过户公司">
            </li>
            <li class="kaihu clearfix">
              <span>备注</span>
              <textarea name="remark" ></textarea>
           </li>
        </form>
      </ul>    
    </div> -->

    <div class="xuanzhe1">
        <ul>
            <form id="transForm" name="transForm">
                <input type="hidden" name="order_id" value="{$order.order_id}"/>
                <input type="hidden" name="car_id" value="{$car.car_id}"/>
                <input type="hidden" name="owner_id" value="{$owner.owner_id}" />
                <li class="transfer">
                    <input id="transfer_limit" type="hidden" name="transfer_limit" value="{$detail.transfer_limit}">
                    <span>车辆落户</span>
                    <?php if (!isset($transter_info['transfer_limit']) || $transter_info['transfer_limit']==3) { ?>
                    <em class="" data-id="1">本地</em>
                    <em class="" data-id="2">外迁</em>
                    <?php } elseif ($transter_info['transfer_limit']==1) { ?>
                    <em class="active" data-id="1">本地</em>
                    <?php } elseif ($transter_info['transfer_limit']==2) { ?>
                    <em class="active" data-id="2">外迁</em>
                    <?php } ?>
                </li>
                <li class="reason clearfix">
                    <span>备注</span>
                    <textarea name="reauction_remark" cols="50"
                              onKeyDown="textCounter(this.form.reauction_remark, this.form.remLen, 50);" onKeyUp="textCounter(this.form.reauction_remark, this.form.remLen, 50);"></textarea>
                    <em></em>
                </li>
            </form>
        </ul>
    </div>

    <div class="yongBtn">
      <input id="confirm_transfer" type="button" value="确认过户" class="queding">
      <input name="重置" type="reset" onclick="history.back();" class="quxiao" value="返回"></div>
  </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".yuList ul .transfer em").click(function () {
            $(".yuList ul .transfer em").removeClass("active");
            $("#transfer_limit").val($(this).attr('data-id'));
            $(this).addClass("active");
        })
    });

    $("#confirm_transfer").click(function(){

        $.post("/Transfer/confirmTransfer",$("#transForm").serialize(),function(data){
            if(data.code!=200){
                shibai_alert(data.msg,1500)
                return false;
            }
            btn_alert("确认成功",1500,function(){
                //location.href=document.referrer
                submit_success();
            });            
        },"json");
    });

    //提交成功后
    function submit_success() {
        var order_type_new = "{:I('get.order_type')}";
        var Request = new UrlSearch(); //实例化
        var order_type = Request.order_type;
        if(order_type == '' || order_type == null){ //如果没有传 order_type ,就追加上order_type 然后返回
            location.href = document.referrer+"?order_type="+"{:I('get.order_type')}";
        }else{
            if(order_type_new == order_type){ //如果新的order_type 和 来源的order_type 一致。那么直接返回
                location.href=document.referrer;
            }else{ //否则更新成新的 order_type
                var num = document.referrer.indexOf("?")
                var url_no_parameter = document.referrer.substr(0,num);
                location.href = url_no_parameter+"?order_type="+"{:I('get.order_type')}";
            }
        }

        return;
    }
    
    //初始化url地址
    function UrlSearch()
    {
        var name,value;
        var str = document.referrer; //url地址
        var num = str.indexOf("?")
        str = str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]

        var arr=str.split("&"); //各个参数放到数组里
        for(var i=0;i < arr.length;i++){
            num=arr[i].indexOf("=");
            if(num>0){
                name=arr[i].substring(0,num);
                value=arr[i].substr(num+1);
                this[name]=value;
            }
        }
    }
</script>